#include<cstdio>
#include<cmath>

int main()
{
	double a, d;
	int n;
	std::scanf("%lf%lf%d",&a,&d,&n);
	for (int i = 1; i <= n; i++) {
		double x, y, r;
		r = std::fmod(i * d, 4 * a);
		if (r <= a) {
			x = r, y = 0;
		} else if (r <= 2 * a) {
			x = a; y = r - a;
		} else if (r <= 3 * a) {
			x = a - (r - 2 * a); y = a;
		} else {
			x = 0; y = a - (r - 3 * a);
		}
		std::printf("%.10f %.10f\n", x, y);
	}
}
